{% extends "base.html" %}

{% block sidebar %}
	{% if logged %}
	logged
	{% else %}
	<h2>Not logged-in</h2>
	<a href="{{ login_logout_url }}">Login</a>
	{% endif %}
{% endblock sidebar %}

{% block content %}
    <h1>Recherche</h1>
    <form>
      <fieldset>
        <label for="normalText">Requete</label>
        <input type="text" value="{{ q }}" name="q" id="q" class="width_3" placeholder="mots clés" autofocus />
        <!-- placeholder text is text that stays in the input field until clicked, autofocus will select that element on the page -->
        <div class="clear"></div>
        <button class="submit">balancer la purée</button>
      </fieldset>
    </form>
    <h1>Resultats</h1>
    <!-- {{ result }} -->
    <table>
      <tr>
        <th>vendeur</th>
        <th>image</th>
        <th>objet</th>
        <th>prix</th>
        <th>fdp</th>
        <th>date</th>
      </tr>
    {% for item in result %}
      <tr>
        <td>{{ item.seller }}</td>
        <td>{% if item.image %}<a href="{{ item.link }}" title="{{ item.id }}"><img src="{{ item.image }}"/></a>{% else %}&nbsp;{% endif %}</td>
        <td><a href="{{ item.link }}" title="{{ item.id }}">{{ item.title }}</a></td>
        <td>{{ currency }}{{ item.price }}</td>
        <td>{{ item.shipping }}</td>
        <td>{{ item.ends }}</td>
      </tr>
    {% endfor %}
      
      
    </table>
    <ul>

    </ul>

{% endblock %}